import Vue from 'vue'
import Router from 'vue-router'
import Index from '../views/index/Index'

import Login from '@/views/login/Login'; // 登录
import Resgiter from '@/views/login/Resgiter'; // 注册
import Find from '@/views/login/Find'; // 重置密码

import Home from '@/views/home/Home'; // 首页
import RealTime from '@/views/realTime/RealTime'; // 实时榜单
import GoodsList from '@/views/goodsList/GoodsList'; // 好单预告
import PictureTool from '@/views/pictureTool/PictureTool'; // 好单预告

import Person from '@/views/person/Person'; // 后台管理

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'index',
      component: Index,
      children:[
        // 首页
        {
          path: '/',
          name: 'Home',
          component: Home
        },
        // 实时榜单
        {
          path: '/real_time',
          name: 'RealTime',
          component: RealTime
        },
        // 榜单预告
        {
          path: '/goods_list',
          name: 'GoodsList',
          component: GoodsList
        },
        // 图片生成工具
        {
          path: '/picture_tool',
          name: 'PictureTool',
          component: PictureTool
        },
      ]
    },
    // 登录
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    // 注册
    {
      path: '/resgiter',
      name: 'Resgiter',
      component: Resgiter
    },
    // 找回密码
    {
      path: '/find',
      name: 'Find',
      component: Find
    },

    // 后台管理
    {
      path: '/person',
      name: 'Person',
      component: Person
    },
  ]
})
